package BookParts;

import java.text.BreakIterator;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: zhunusbekova.arailym
 * Date: 22.08.13
 * Time: 13:43
 * To change this template use File | Settings | File Templates.
 */
public class Paragraph extends TextPart<Sentence>{
    private static final long serialVersionUID = 1L;

    public Paragraph(String pgh) {
        BreakIterator iterator = BreakIterator.getSentenceInstance();
        iterator.setText(pgh);
        int start = iterator.first();
        for (int end = iterator.next(); end != BreakIterator.DONE; start = end, end = iterator
                .next()) {
            this.add(new Sentence(pgh.substring(start, end)));
        }
    }


}
